package com.example.auto.config;

import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * @author sunpeng
 * @Date 2021-08-24 9:52
 */

@Component
public class AutoInIt implements ApplicationRunner {
    @Override
    public void run(ApplicationArguments args) throws Exception {
/*        MyThread thread1 = new MyThread();
        MyThread2 thread2 = new MyThread2();
        thread1.start();
        thread2.start();*/

        new Thread(){
            @Override
            public void run() {
                System.out.println("Thread 1");
            }
        }.start();
        //thread.start();
/*        for (int i = 0; i < 10000; i++) {
            System.out.println("000"+i);
        }*/
        System.out.println(1111);

        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                System.out.println("Runnable 1");
            }
        };
        Thread thread = new Thread(runnable);
        thread.start();

    }
}
